﻿using System;

class DescendingOrder
{
    static void Main()
    {
        //Exercise 4.
        //Sort 3 real values in descending order using nested if statements.

        Console.Write("Enter the first number:  ");
        double firstNumber = double.Parse(Console.ReadLine());
        Console.Write("Enter the second number:  ");
        double secondNumber = double.Parse(Console.ReadLine());
        Console.Write("Enter the third number:  ");
        double thirdNumber = double.Parse(Console.ReadLine());
        Console.WriteLine();        
        double smallest;
        double biggest;

        if (firstNumber < secondNumber && firstNumber < thirdNumber)
        {
            smallest = firstNumber;
            if (secondNumber < thirdNumber)
            {
            biggest = thirdNumber;
            Console.WriteLine("The biggest number is:  {0}.", biggest);
            Console.WriteLine("Descending order: {0}, {1}, {2}.", smallest, secondNumber, biggest);
            }
            else
            {            
                biggest = secondNumber;
                Console.WriteLine("Descending order: {0}, {1}, {2}.", smallest, thirdNumber, biggest);            
            }
        }

       
        if (secondNumber < firstNumber && secondNumber < thirdNumber)
        {
            smallest = secondNumber;
            if (firstNumber < thirdNumber)
            {
                biggest = thirdNumber;
                Console.WriteLine("Descending order: {0}, {1}, {2}.", smallest, firstNumber, biggest);
            }
            else
            {
                biggest = firstNumber;
                Console.WriteLine("Descending order: {0}, {1}, {2}.", smallest, thirdNumber, biggest);
            }
        }


        if (thirdNumber < firstNumber && thirdNumber < secondNumber)
        {
            smallest = thirdNumber;
            if (firstNumber < secondNumber)
            {
                biggest = secondNumber;
                Console.WriteLine("Descending order: {0}, {1}, {2}.", smallest, firstNumber, biggest);
            }
            else
            {
                biggest = firstNumber;
                Console.WriteLine("Descending order: {0}, {1}, {2}.", smallest, secondNumber, biggest);
            }
        }
        
        Console.WriteLine();

    }
}

